﻿namespace PortableRiotGames
{
    using PortableRiotGames.Fluent.Champion;
    using PortableRiotGames.Fluent.Game;
    using PortableRiotGames.Fluent.Stats;
    using PortableRiotGames.Fluent.Summoner;
    using PortableRiotGames.Fluent.Team;
    using System.ComponentModel;

    /// <summary>
    /// Starting point for the fluent Riot Games API wrapper. It is designed to help you begin exploring and developing with the API as quickly as possible.
    /// </summary>
    public static class RiotGamesWebAPI
    {
        private static string _key;
        private static Region _region;

        /// <summary>
        /// The default region for api requests if the region is not specified.
        /// </summary>
        public static Region DefaultRegion
        {
            get { return _region; }
        }

        /// <summary>
        /// The developer key. Get your developer key from https://developer.riotgames.com/.
        /// </summary>
        public static string DeveloperKey
        {
            get { return _key; }
        }

        /// <summary>
        /// Interface: champion-v1.1 [EUNE, EUW, NA]
        /// </summary>
        /// <returns></returns>
        public static ChampionBuilderHandler Champion()
        {
            return new ChampionBuilderHandler();
        }

        /// <summary>
        /// game-v1.2 [NA, EUNE, EUW]
        /// </summary>
        /// <returns></returns>
        public static GameBuilderHandler Game()
        {
            return new GameBuilderHandler();
        }

        /// <summary>
        /// Interface: league-v2.2 [NA, TR, BR, EUW, EUNE]
        /// </summary>
        /// <returns></returns>
        public static LeagueBuilderHandler League()
        {
            return new LeagueBuilderHandler();
        }

        /// <summary>
        /// Set the default region for api requests if the region is not specified.
        /// </summary>
        /// <param name="region">Region.</param>
        public static void SetDefaultRegion(Region region)
        {
            _region = region;
        }

        /// <summary>
        /// Set the api_key used for requests.
        /// </summary>
        /// <param name="key">Key value.</param>
        public static void SetDeveloperKey(string key)
        {
            _key = key;
        }

        /// <summary>
        /// Interface: stats-v1.2 [EUW, NA, EUNE]
        /// </summary>
        /// <returns></returns>
        public static StatsBuilderHandler Stats()
        {
            return new StatsBuilderHandler();
        }

        /// <summary>
        /// Interface: summoner-v1.2 [NA, EUNE, EUW]
        /// </summary>
        /// <returns></returns>
        public static SummonerBuilderHandler Summoner()
        {
            return new SummonerBuilderHandler();
        }

        /// <summary>
        /// Interface: team-v2.2 [TR, BR, NA, EUNE, EUW]
        /// </summary>
        /// <returns></returns>
        public static TeamBuilderHandler Team()
        {
            return new TeamBuilderHandler();
        }

        #region Hidden

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static new bool Equals(object objA, object objB)
        {
            return RiotGamesWebAPI.Equals(objA, objB);
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public static new bool ReferenceEquals(object objA, object objB)
        {
            return RiotGamesWebAPI.ReferenceEquals(objA, objB);
        }

        #endregion Hidden
    }
}